#pragma once

#include <boostext/smart_ptr.hpp>
#include <engine.ui/StyleDefinition.hpp>
#include "Glyph.hpp"
#include "Font.hpp"




class StyleDocument
	: public Engine::Ui::StyleDefinition<AdvancedFont, AdvancedGlyph>
{
public:

	/**
	 * Although StyleDefinition already implements the load function, we have to overwrite it.
	 * StyleDefinition is expecting a working css definition that can be used to render something,
	 * but the StyleDocument class is meant to be edited, so it must be able to hold an incorrect
	 * css definition that may be fixed by the user.
	 */
	void load(const QDomElement& xml, const QDir& path);
	void save(QDomDocument& doc, QDomElement& xml, const QFileInfo& info);

	QImage generateImage();


	Glyphs& glyphs();
	const Glyphs& glyphs() const;

	Fonts& fonts();
	const Fonts& fonts() const;
};
///////////////////////////////////////////////////////////////////////////////////////////////////

DEFINE_LOOSE_PTR(StyleDocument);
